package com.bupt.ilink.mapper.userManagement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bupt.ilink.entity.userManagement.UserPermissions;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface UserPermissionsMapper extends BaseMapper<UserPermissions> {
    Boolean checkUserPermission(String userId, Long teamId, String sourceFlowId);

    @Select("SELECT source_authority FROM User_permissions WHERE user_id = #{userId} AND team_id = #{teamId} AND source_flow_id = #{sourceFlowId}")
    Boolean checkSourceAuthority(@Param("userId") String userId, @Param("teamId") Long teamId, @Param("sourceFlowId") String sourceFlowId);

}